#ifdef  PAYMENT_DEFINED


#ifndef PAYMENT_H
#define PAYMENT_H

#include <define.h>
#include <transact.h>
#include <print.h>
#include <report.h>
#include <sizes.h>


extern char *szGlobalPMTFileName;

#define SELECTION_ONE           1
#define SELECTION_TWO           2
#define CASH_PAYMENT			0                   /* Payment type CASH */
#define CHECK_PAYMENT			1                   /* Payment type CHECK */
#define FIXED_INSTALLMENTS      0                   /* Installment type FIXED */
#define VARIABLE_INSTALLMENTS   1                   /* Installment type VARIABLE*/
#define PLAN_SIZE				1					/* Size of Plan # */
#define MENU_STRINGS_SIZE	  	12
#define PLAN_NAME_SIZE 			12					/* Plan Name Size */
/* The Payments Table record structure */
typedef struct TagPMT_REC
{
        char    szPLNFileName[FILENAME_SIZE + 1];  /*Plan 1 name to display */
        int     inDefaultInstallments;             /*Default amount of Installments*/
        int     inMinInstallments;                 /*Minimum amount of Installments*/
        int     inMaxInstallmentsMerch;            /*Maximum amount of Installments*/
        int     inMaxInstallmentsAdm;              /*Maximum amount of Installments*/

#ifdef _WINDOWS
        int  fAskForPlanWhenOneInst: 1;  /* 0 - No, 1 - Yes */
        int  fPlansAlwd        : 1;      /* 0 - No, 1 - Yes */
        int  fVariableInstAlwd : 1;      /* 0 - No, 1 - Yes */
        int  fInstalmntAlwdAdm : 1;      /* 0 - No, 1 - Yes */
        int  fInstalmntAlwdMerch : 1;    /* 0 - No, 1 - Yes */
        int  f1                : 1;      /* padded bits */
        int  f2                : 1;      /* padded bits */
        int  f3                : 1;      /* padded bits */
        int  f4                : 1;      /* padded bits */
        int  f5                : 1;      /* padded bits */
        int  f6                : 1;      /* padded bits */
        int  f7                : 1;      /* padded bits */
        int  f8                : 1;      /* padded bits */
        int  f9                : 1;      /* padded bits */
        int  f10               : 1;      /* padded bits */
        int  f11               : 1;      /* padded bits */
#else
        int  f11               : 1;      /* padded bits */
        int  f10               : 1;      /* padded bits */
        int  f9                : 1;      /* padded bits */
        int  f8                : 1;      /* padded bits */
        int  f7                : 1;      /* padded bits */
        int  f6                : 1;      /* padded bits */
        int  f5                : 1;      /* padded bits */
        int  f4                : 1;      /* padded bits */
        int  f3                : 1;      /* padded bits */
        int  f2                : 1;      /* padded bits */
        int  f1                : 1;      /* padded bits */
   	int  fInstalmntAlwdMerch : 1;            /* 0 - No, 1 - Yes */
   	int  fInstalmntAlwdAdm : 1;            	/* 0 - No, 1 - Yes */
	int  fVariableInstAlwd : 1;            	/* 0 - No, 1 - Yes */
   	int  fPlansAlwd   	  : 1; 		      	/* 0 - No, 1 - Yes */
	int  fAskForPlanWhenOneInst: 1;				/* 0 - No, 1 - Yes */
#endif
}PMT_REC;

#define PMT_FILE_NAME       "pmt.dat"
#define SIZE_PMT_REC   sizeof(PMT_REC)

typedef struct TagPLN_REC
{
	char szPlan[3];
	char szPlanName[FILENAME_SIZE + 1];
}PLN_REC;

#define SIZE_PLN_REC   sizeof(PLN_REC)

#define PAYMENT_FUNCS 	5
extern  FUNCTION_TABLE srPaymentFuncs[];

extern char *szGlobalPMTMessageFileName;

int inAddPaymentFunctions(void);
int inGetInstallments(TRANSACTION_OBJECT *);
int inGetPlans(TRANSACTION_OBJECT *);
int inGetDeposit(TRANSACTION_OBJECT *);


/* @struct STRING_SELECTIONS | Menu strings */

typedef struct TagSTR_SELECTIONS
{
	char szSelectionString[MENU_STRINGS_SIZE + 1];   /* @field Menu string */
} STR_SELECTIONS;

/* @struct CHOOSE_ONEMENU | Menu */

typedef struct TagCHOOSE_ONEMENU
{
	int inNumSelections;					/* @field Number of selections in menu */
	int inDefaultSelection;     			/* @field Default selection */
	int *inMsgSelections;       			/* @field Array of selections */
	STR_SELECTIONS *srStrSelections; 	/* @field Array of Selections */
} CHOOSE_ONEMENU;


#endif

#endif // PAYMENT_DEFINED
